var viewServiceProxy = new serviceProxy("Rest.svc/");

function OnPageError(xhr, errorMsg, thrown) {

    var errorString;
    if (typeof xhr == "string") {
        alert(xhr);
        return;
    }

    if (errorMsg && errorMsg != "error")
        alert("errormsg: " + errorMsg);

    else if (typeof (xhr.responseText) == "string" && xhr.responseText != "") {
        var err = JSON2.parse(xhr.responseText);
        if (typeof (err) == "object")
            alert(err.Message);
        else
            alert("Unknown server error.");
    }
    else
        alert("Unknown error occurred in callback.");
}

function IsNullOrEmpty(value) {
    if (value == null || value == '')
        return true;
    else
        return false;
}
